package com.xiaoyuer.weixin.task;

import com.xiaoyuer.weixin.controller.WeChatController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class PushTask {

    @Autowired
    WeChatController weChatController;

    //每日 早上9点 定时推送
    @Scheduled(cron = "0 0 9 * * ?")
    public void scheduledPush() {
        log.info("开始执行了===>推送消息");
        weChatController.push();
        log.info("结束执行了===>推送消息");
    }

}
